﻿<%@ Page Language="C#" MasterPageFile="~/Style/Admin/AdminCPMP.master" AutoEventWireup="true" CodeBehind="Mail.aspx.cs" Inherits="OnlineFloralShop.Admin.Mail.Mail" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_MainAdmin" runat="server">
<div class="boxsearch">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 >Mail</h1>
    
  </div>
  <div class="content2">
    <form id="form" action="">
      <table style="width:100%;">
        <tbody><tr>
          <td  style="width:20%;">From:</td>
          <td><select name="store_id">
              <option value="0">Default</option>
                          </select></td>
        </tr>
        <tr>
          <td>To:</td>
          <td><select name="group">
              <option value=""></option>
                            <option value="newsletter">All Newsletter Subscribers</option>
                                          <option value="customer">All Customers</option>
                          </select></td>
        </tr>
        <tr>
          <td></td>
          <td><table width="100%">
              <tbody><tr>
                <td style="padding: 0;" colspan="3"><input type="text" id="search" value="" style="margin-bottom: 5px;" class="search_txt"/>
                  <a style="margin-bottom: 5px;" class="button"><span><asp:Button Text="Search" runat="server" CssClass="button" /></span></a></td>
              </tr>
              <tr>
              <td>
                  <asp:ListView ID="ListView1" runat="server">
                  <LayoutTemplate>
          <table cellpadding="2" border="1" runat="server" id="tblorder">
            <tr id="Tr1" runat="server">
              <th id="Th1" runat="server">
                  <asp:CheckBox ID="checkall" runat="server" /></th>
              <th id="Th2" runat="server">Email</th>
              <th id="Th3" runat="server">UserName</th>
            </tr>
            <tr runat="server" id="itemPlaceholder" />
          </table>
          <asp:DataPager runat="server" ID="ContactsDataPager" PageSize="5">
            <Fields>
              <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true"
                FirstPageText="|&lt;&lt; " LastPageText=" &gt;&gt;|"
                NextPageText=" &gt; " PreviousPageText=" &lt; " />
            </Fields>
          </asp:DataPager>
        </LayoutTemplate>
        <ItemTemplate>
        <tr id="Tr2" runat="server">
            <td align="center">
                <asp:CheckBox ID="checked" runat="server" />
            </td>
            <td  align="center">
              <asp:Label ID="Email" runat="Server" Text='<%#Eval("Email") %>' />
            </td><td  align="center">
            <asp:Label ID="UserName" runat="Server" Text='<%#Eval("UserName") %>' />
            </td>
            </tr>
        </ItemTemplate>
                  </asp:ListView>
              </td>
              </tr>
            </tbody></table></td>
        </tr>
		<tr>
		  <td>To customers who have ordered Products:</td>
		  <td><table>
			  <tbody><tr>
			    <td style="padding: 0;" colspan="3">
                    <asp:DropDownList ID="DropDownList1" runat="server">
                    </asp:DropDownList>
                </td>
			  </tr>
			  <tr>	    
			    <asp:ListView ID="ListView2" runat="server">
                  <LayoutTemplate>
          <table cellpadding="2" border="1" runat="server" id="tblorder">
            <tr id="Tr1" runat="server">
              <th id="Th1" runat="server">
                  <asp:CheckBox ID="checkall" runat="server" /></th>
              <th id="Th2" runat="server">Email</th>
              <th id="Th3" runat="server">UserName</th>
            </tr>
            <tr runat="server" id="itemPlaceholder" />
          </table>
          <asp:DataPager runat="server" ID="ContactsDataPager" PageSize="5">
            <Fields>
              <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true"
                FirstPageText="|&lt;&lt; " LastPageText=" &gt;&gt;|"
                NextPageText=" &gt; " PreviousPageText=" &lt; " />
            </Fields>
          </asp:DataPager>
        </LayoutTemplate>
        <ItemTemplate>
        <tr id="Tr2" runat="server">
            <td align="center">
                <asp:CheckBox ID="checked" runat="server" />
            </td>
            <td  align="center">
              <asp:Label ID="Email" runat="Server" Text='<%#Eval("Email") %>' />
            </td><td  align="center">
            <asp:Label ID="UserName" runat="Server" Text='<%#Eval("UserName") %>' />
            </td>
            </tr>
        </ItemTemplate>
                  </asp:ListView>		    
			    
			  </tr>
		    </tbody></table>
		    <div id="product_item">
		    </div></td>
		</tr>
        <tr>
          <td><span class="required">*</span> Subject:</td>
          <td><input name="subject" value=""/>
            </td>
        </tr>
        <tr>
          <td><span class="required">*</span> Message:</td>
          <td><textarea  cols="50" rows="20" name="message" id="message" style="visibility: hidden; display: none; "></textarea>          
            </td>
        </tr>
      </tbody></table>
      <div id="customer_to">
              </div>
    </form>
  </div>
  <script type="text/javascript">
		

				CKEDITOR.replace( 'message',
					{
						/*
						 * Style sheet for the contents
						 */
						contentsCss : 'body {color:#000; background-color#:FFF;}',

						/*
						 * Simple HTML5 doctype
						 */
						docType : '<!DOCTYPE HTML>',

						/*
						 * Core styles.
						 */
						coreStyles_bold	: { element : 'b' },
						coreStyles_italic	: { element : 'i' },
						coreStyles_underline	: { element : 'u'},
						coreStyles_strike	: { element : 'strike' },

						/*
						 * Font face
						 */
						// Define the way font elements will be applied to the document. The "font"
						// element will be used.
						font_style :
						{
								element		: 'font',
								attributes		: { 'face' : '#(family)' }
						},

						/*
						 * Font sizes.
						 */
						fontSize_sizes : 'xx-small/1;x-small/2;small/3;medium/4;large/5;x-large/6;xx-large/7',
						fontSize_style :
							{
								element		: 'font',
								attributes	: { 'size' : '#(size)' }
							} ,

						/*
						 * Font colors.
						 */
						colorButton_enableMore : true,

						colorButton_foreStyle :
							{
								element : 'font',
								attributes : { 'color' : '#(color)' }
							},

						colorButton_backStyle :
							{
								element : 'font',
								styles	: { 'background-color' : '#(color)' }
							},

						/*
						 * Styles combo.
						 */
						stylesSet :
								[
									{ name : 'Computer Code', element : 'code' },
									{ name : 'Keyboard Phrase', element : 'kbd' },
									{ name : 'Sample Text', element : 'samp' },
									{ name : 'Variable', element : 'var' },

									{ name : 'Deleted Text', element : 'del' },
									{ name : 'Inserted Text', element : 'ins' },

									{ name : 'Cited Work', element : 'cite' },
									{ name : 'Inline Quotation', element : 'q' }
								],

						on : { 'instanceReady' : configureHtmlOutput }
					});

/*
 * Adjust the behavior of the dataProcessor to avoid styles
 * and make it look like FCKeditor HTML output.
 */
function configureHtmlOutput( ev )
{
	var editor = ev.editor,
		dataProcessor = editor.dataProcessor,
		htmlFilter = dataProcessor && dataProcessor.htmlFilter;

	// Out self closing tags the HTML4 way, like <br>.
	dataProcessor.writer.selfClosingEnd = '>';

	// Make output formatting behave similar to FCKeditor
	var dtd = CKEDITOR.dtd;
	for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) )
	{
		dataProcessor.writer.setRules( e,
			{
				indent : true,
				breakBeforeOpen : true,
				breakAfterOpen : false,
				breakBeforeClose : !dtd[ e ][ '#' ],
				breakAfterClose : true
			});
	}

	// Output properties as attributes, not styles.
	htmlFilter.addRules(
		{
			elements :
			{
				$ : function( element )
				{
					// Output dimensions of images as width and height
					if ( element.name == 'img' )
					{
						var style = element.attributes.style;

						if ( style )
						{
							// Get the width from the style.
							var match = /(?:^|\s)width\s*:\s*(\d+)px/i.exec( style ),
								width = match && match[1];

							// Get the height from the style.
							match = /(?:^|\s)height\s*:\s*(\d+)px/i.exec( style );
							var height = match && match[1];

							if ( width )
							{
								element.attributes.style = element.attributes.style.replace( /(?:^|\s)width\s*:\s*(\d+)px;?/i , '' );
								element.attributes.width = width;
							}

							if ( height )
							{
								element.attributes.style = element.attributes.style.replace( /(?:^|\s)height\s*:\s*(\d+)px;?/i , '' );
								element.attributes.height = height;
							}
						}
					}

					// Output alignment of paragraphs using align
					if ( element.name == 'p' )
					{
						style = element.attributes.style;

						if ( style )
						{
							// Get the align from the style.
							match = /(?:^|\s)text-align\s*:\s*(\w*);/i.exec( style );
							var align = match && match[1];

							if ( align )
							{
								element.attributes.style = element.attributes.style.replace( /(?:^|\s)text-align\s*:\s*(\w*);?/i , '' );
								element.attributes.align = align;
							}
						}
					}

					if ( !element.attributes.style )
						delete element.attributes.style;

					return element;
				}
			},

			attributes :
				{
					style : function( value, element )
					{
						// Return #RGB for background and border colors
						return convertRGBToHex( value );
					}
				}
		} );
}


/**
* Convert a CSS rgb(R, G, B) color back to #RRGGBB format.
* @param Css style string (can include more than one color
* @return Converted css style.
*/
function convertRGBToHex( cssStyle )
{
	return cssStyle.replace( /(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function( match, red, green, blue )
		{
			red = parseInt( red, 10 ).toString( 16 );
			green = parseInt( green, 10 ).toString( 16 );
			blue = parseInt( blue, 10 ).toString( 16 );
			var color = [red, green, blue] ;

			// Add padding zeros if the hex value is less than 0x10.
			for ( var i = 0 ; i < color.length ; i++ )
				color[i] = String( '0' + color[i] ).slice( -2 ) ;

			return '#' + color.join( '' ) ;
		 });
}
		
			</script>
</div>
</asp:Content>
